export const getListData= (data)=>{
    return {
        type:'GETNEWSLISTS',
        data
    }
}
   export const getData = (data) => {
      return {
            type: 'TRY',
            data
        }
    }
    export function fetchList (data){
        console.log('data',data)
        return dispatch=>{            
            return fetch(`http://10.31.160.25:3000/News/info/${data.id}/${data.page}`,
            {
                method:'POST',
                body:JSON.stringify(data),
                headers:{
                    'Accept': 'application/json',
                    'Content-Type': 'application/json'
                }               
            }).then(res=>{
                 return res.json()
            })
            .then(dataaa=>{
                console.log(dataaa.page,'11111');
                dispatch(getData(data.id))
                dispatch(getListData(dataaa));                 
            })   
        }
        }
